﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;

namespace Nav3
{
    /// <summary>
    /// Lógica de interacción para DlgBuscar.xaml
    /// </summary>
    public partial class DlgBuscar : Window
    {
        public bool isOk;
        public DlgBuscar()
        {
            InitializeComponent();
            this.isOk = false;
            FocusManager.SetFocusedElement(this, this.txtClavePos);
            Keyboard.Focus(this.txtClavePos); 
        }

        private void btnCancelar_Click(object sender, RoutedEventArgs e)
        {
            this.Close();
        }

        private void btnBuscar_Click(object sender, RoutedEventArgs e)
        {
            this.isOk = true;
            this.Close();
        }

        private void txtClavePos_KeyUp(object sender, KeyEventArgs e)
        {
            if (e.Key == Key.Enter)
            {
                this.isOk = true;
                this.Close();
            }
        }
    }
}
